/**
 * @file	custom_tuya_ble_config.h
 * @author	chipsea
 * @brief	
 * @version	0.1
 * @date	2021-04-07
 * @copyright Copyright (c) 2021, CHIPSEA Co., Ltd.
 * @note
 */
 
#ifndef __CUSTOM_TUYA_BLE_CONFIG_H
#define __CUSTOM_TUYA_BLE_CONFIG_H

#include "tuya_ble_type.h"

#define TUYA_BLE_PORT_PLATFORM_HEADER_FILE "tuya_ble_port_cst92f25.h"

#define TUYA_BLE_USE_OS 0
/*
 * TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_BLE                   ble normal
 * TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_REGISTER_FROM_BLE     device register from ble 
 * TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_MESH                  ble mesh
 * TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_WIFI_24G              wifi_2.4g
 * TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_WIFI_5G               wifi_5g 
 * TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_ZIGBEE                zigbee
 * TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_NB                    nb-iot
 * @note: 
 * for example (TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_BLE|TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_MESH|TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_WIFI_24G)
 */
//#define TUYA_BLE_DEVICE_COMMUNICATION_ABILITY  (TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_BLE|TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_WIFI_24G|TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_WIFI_5G)
#ifndef TUYA_BLE_DEVICE_COMMUNICATION_ABILITY
#define TUYA_BLE_DEVICE_COMMUNICATION_ABILITY  (TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_BLE|TUYA_BLE_DEVICE_COMMUNICATION_ABILITY_REGISTER_FROM_BLE)
#endif

/*
 * Whether it is a shared device.
 */
#ifndef TUYA_BLE_DEVICE_SHARED
#define TUYA_BLE_DEVICE_SHARED  0
#endif

/*
 * If it is 1, then sdk need to perform the unbind operation,otherwise sdk do not need.
 */
#ifndef TUYA_BLE_DEVICE_UNBIND_MODE
#define TUYA_BLE_DEVICE_UNBIND_MODE  1
#endif

/*
 * If TUYA_BLE_WIFI_DEVICE_REGISTER_MODE is 1,Mobile app must first sends instructions to query network status after sending the pairing request .
 */
#ifndef TUYA_BLE_WIFI_DEVICE_REGISTER_MODE
#define TUYA_BLE_WIFI_DEVICE_REGISTER_MODE  1
#endif

/*
 * if 1 ,tuya ble sdk authorization self-management
 */
#ifndef TUYA_BLE_DEVICE_AUTH_SELF_MANAGEMENT
#define  TUYA_BLE_DEVICE_AUTH_SELF_MANAGEMENT   1
#endif

 /*
  * TUYA_BLE_SECURE_CONNECTION_WITH_AUTH_KEY     encrypt with auth key
  * TUYA_BLE_SECURE_CONNECTION_WITH_ECC          encrypt with ECDH
  * TUYA_BLE_SECURE_CONNECTION_WTIH_PASSTHROUGH  no encrypt 
  * @note : only choose one 
 */
#ifndef  TUYA_BLE_SECURE_CONNECTION_TYPE
#define  TUYA_BLE_SECURE_CONNECTION_TYPE  TUYA_BLE_SECURE_CONNECTION_WITH_AUTH_KEY
#endif 


/*
 * if 1 ,ble sdk will update mac address with with the address of the authorization information.
 */
#ifndef  TUYA_BLE_DEVICE_MAC_UPDATE
#define  TUYA_BLE_DEVICE_MAC_UPDATE         0 
#endif

/*
 * if 1 ,after update mac will reset.
 */
#ifndef  TUYA_BLE_DEVICE_MAC_UPDATE_RESET
#define  TUYA_BLE_DEVICE_MAC_UPDATE_RESET   0 
#endif

/*
 * if defined ,ble sdk use platform memory heap.
 */
#ifndef  TUYA_BLE_USE_PLATFORM_MEMORY_HEAP
#define  TUYA_BLE_USE_PLATFORM_MEMORY_HEAP   0 
#endif

/*
 * 
 */
#ifndef  TUYA_BLE_GATT_SEND_DATA_QUEUE_SIZE
#define TUYA_BLE_GATT_SEND_DATA_QUEUE_SIZE 10
#endif

/*
 * if defined ,include UART module
 */
//#define TUYA_BLE_UART 


/*
 * if defined ,include product test module
 */
//#define TUYA_BLE_PRODUCTION_TEST 


/*
 * gatt mtu max sizes 
 */
#ifndef TUYA_BLE_DATA_MTU_MAX
#define TUYA_BLE_DATA_MTU_MAX  244
#endif

/*
 * if defined ,enable sdk log output
 */

#ifndef TUYA_BLE_LOG_ENABLE
#define TUYA_BLE_LOG_ENABLE 0
#endif

#ifndef TUYA_BLE_LOG_COLORS_ENABLE
#define TUYA_BLE_LOG_COLORS_ENABLE  0
#endif 

#ifndef TUYA_BLE_LOG_LEVEL
#define TUYA_BLE_LOG_LEVEL  TUYA_BLE_LOG_LEVEL_DEBUG
#endif


/*
 * if defined ,enable app log output
 */

#ifndef TUYA_APP_LOG_ENABLE
#define TUYA_APP_LOG_ENABLE 0 
#endif

#ifndef TUYA_APP_LOG_COLORS_ENABLE
#define TUYA_APP_LOG_COLORS_ENABLE  0
#endif 

#ifndef TUYA_APP_LOG_LEVEL
#define TUYA_APP_LOG_LEVEL  TUYA_APP_LOG_LEVEL_DEBUG
#endif

/*
 * MACRO for advanced encryption,if 1 will use user rand check.
 */
#ifndef TUYA_BLE_ADVANCED_ENCRYPTION_DEVICE
#define TUYA_BLE_ADVANCED_ENCRYPTION_DEVICE 0
#endif



//nv
/* The minimum size of flash erasure. May be a flash sector size. */
#ifndef TUYA_NV_ERASE_MIN_SIZE
#define TUYA_NV_ERASE_MIN_SIZE         (0x1000)
#endif
/* the flash write granularity, unit: byte*/
#ifndef TUYA_NV_WRITE_GRAN
#define TUYA_NV_WRITE_GRAN             (4)
#endif
/* start address */
#ifndef TUYA_NV_START_ADDR
#define TUYA_NV_START_ADDR              0x67000 
#endif

/* area size. */
#ifndef TUYA_NV_AREA_SIZE
#define TUYA_NV_AREA_SIZE              (4*TUYA_NV_ERASE_MIN_SIZE)
#endif

/*MACRO for production test module*/
#ifndef TUYA_BLE_APP_VERSION_STRING
#define TUYA_BLE_APP_VERSION_STRING  "2.0" 	
#endif

#ifndef TUYA_BLE_APP_BUILD_FIRMNAME_STRING
#define TUYA_BLE_APP_BUILD_FIRMNAME_STRING  "tuya_ble_sdk_app_demo_xxx"  
#endif


#define TUYA_BLE_APP_PID   "q3evkqhm"//"Pq0qYz7H"
#define TUYA_BLE_APP_UUID  "tuya1428e7430551"
#define TUYA_BLE_APP_KEY   "KhNySLXs5IPyslJILi2nieriPLLihXU3"

//#define TUYA_BLE_APP_UUID  "sp01df029b1a8724"
//#define TUYA_BLE_APP_KEY   "GjFwl1VIeWfseJhDH28dVuMpMoatJV0g"

#endif



